<?php

$dbOrigem = mysql_connect("mysql07.rotondano.com.br", "rotondano6", "mmrProjetos@");
mysql_select_db("rotondano6");

$dbDestino = mysql_connect("mysql14.rotondano.com.br", "rotondano13", "Yoshimar88");
mysql_select_db("rotondano13");


$sql = sprintf("SELECT menu,titulo,url,Automatico,tabela FROM Menu_mount WHERE Automatico='0'");
$result = mysql_query($sql, $dbOrigem);
if($result == 0)
{
     printf("Falha: %s\n", mysql_error($dbOrigem));
     printf("%s\n", $sql);
     exit();
}
if(mysql_num_rows($result) > 0)
{
     while($myrow = mysql_fetch_row($result))
     {
          $sql1 = sprintf("INSERT INTO Menu_mount VALUES('0','$myrow[0]','$myrow[1]','$myrow[2]','$myrow[3]','$myrow[4]')");
          //printf("<p>%s</p>", $sql1);
          $result1 = mysql_query($sql1, $dbDestino);
          if($result1 == 0)
          {
               printf("Falha: %s\n", mysql_error($dbDestino));
               printf("%s\n", $sql1);
               exit();
          }
     }
}
mysql_close($dbOrigem);
mysql_close($dbDestino);
?>
